<template>
  <el-dialog :title="dataList.test" :visible.sync="dataList.guan">
    <el-form :model="dataList">
      <el-form-item label="优惠券类型" :label-width="formLabelWidth">
        <el-radio-group v-model="dataList.type">
          <el-radio :label="0">通用券</el-radio>
        </el-radio-group>
      </el-form-item>

      <el-form-item label="优惠券名称" :label-width="formLabelWidth">
        <el-input v-model="dataList.title" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="优惠券面值" :label-width="formLabelWidth">
        <el-input v-model="dataList.coupon_price" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="优惠券最低消费" :label-width="formLabelWidth">
        <el-input v-model="dataList.use_min_price" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="优惠券有效期限" :label-width="formLabelWidth">
        <el-input v-model="dataList.coupon_time" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="排序" :label-width="formLabelWidth">
        <el-input v-model="dataList.sort" autocomplete="off"></el-input>
      </el-form-item>

      <el-form-item label="状态" :label-width="formLabelWidth">
        <el-radio-group v-model="dataList.status">
          <el-radio :label="1">显示</el-radio>
          <el-radio :label="0">隐藏</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dataList.guan = false">取 消</el-button>
      <el-button type="primary" @click="sure">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  props: ["dataList"],
  data() {
    return {
      formLabelWidth: "120px",
    };
  },

  methods: {
    sure(){
      this.dataList.guan=false
      this.$emit("add",this.dataList)
    }
  },
};
</script>
<style lang='scss' scoped>
</style>